<?php
namespace App\Http\Controllers\Map;
use App\Http\Controllers\Controller;
use App\Models\Position;
use Illuminate\Support\Facades\Request;
use App\Models\Customers;
use Illuminate\Support\Facades\DB;

class IndexController extends Controller
{
     
   public function map()
   {
        if(Request::ajax()){
          $positions=Customers::with('position')
                      ->whereHas('position',function ($query) {
                            $query->where('position','<>','');
                      })->select('id','shortform','address','joindate')
                      ->take(20)
                      ->get(); 
             return response()->json($positions); 
        }else{
             return response()->json('no-Access');
        }
   }
   public function one()
   {

            
           
   }
   
   
   
   
   
   
   
   
   
}


